<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Web截屏控件2演示界面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="Stylesheet" href="scp/skygqbox.css" />
    <link type="text/css" rel="Stylesheet" href="scp/scp.css" />
    <script type="text/javascript" src="scp/jquery-1.7.2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="scp/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="scp/skygqbox.js" charset="utf-8"></script>
    <script type="text/javascript" src="scp/scp.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="scp/scp.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="scp/scp.js" charset="utf-8"></script>
</head>
<body>
    <div id="msg"></div>
    <div id="ScreenCaptureDiv">
        <input id="BtnCapture" type="button" value="截取屏幕区域" />
        <input id="BtnCapture2" type="button" value="截屏时隐藏当前窗口" />
        <input id="BtnCapture3" type="button" value="截取全屏" />
        <input id="BtnCapture6" type="button" value="截取全屏（编辑）" />
        <input id="BtnCapture4" type="button" value="截取指定区域" />
        <input id="BtnCapture5" type="button" value="粘贴" />
        <img id="ScreenImg" alt="截屏图片" style="display: none" />
    </div>
    <script type="text/javascript" language="javascript">

        //根路径：http://localhost/api/scp/
        var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "upload.aspx"
        ].join("");

        var scp = ScreenCapture.getInstance({
            PostUrl: api,
            Cookie: 'ASP.NET_SessionId=<%=Session.SessionID%>',
            Fields: { uname: "test" },
            event: {
                hotKey: function () {
                    setTimeout(function () {
                        scp.Capture2();
                    }, 100);
                },
                postComplete: function (url) {
                    $("#ScreenImg").attr("src", url + "?t=" + new Date().getTime());
                    $("#ScreenImg").show();
                }
            }
        }).loadAuto();

        $(function () {
            $("#BtnCapture").click(function () { scp.Capture(); });
            $("#BtnCapture2").click(function () { scp.CaptureHide(); });
            $("#BtnCapture3").click(function () { scp.CaptureScreen(); });
            $("#BtnCapture6").click(function () { scp.CaptureScreen(true); });
            $("#BtnCapture4").click(function () { scp.CaptureRect(0, 0, 100, 100); });
            $("#BtnCapture5").click(function () { scp.Paste(); });
        });
    </script>
</body>
</html>